//展示作战步骤动画
var processAnimation = {
		
	_processId : 0,
	
	_currentDuration : 0,
	
	_timeoutHandler : null,
	
	_PlayOneProcess : function(){
		var data = wholeProcess[campaign.time_ref.current_step][processAnimation._processId];
		processCursor[data.type].Play(data);
		processAnimation._currentDuration = data.duration;
		
		if (++processAnimation._processId <  wholeProcess[campaign.time_ref.current_step].length){
			processAnimation._timeoutHandler = setTimeout(processAnimation._PlayOneProcess, processAnimation._currentDuration * 1000);
		}
	},
	
	duration : 0,
	
	Play : function(){
		processAnimation.duration = 0;
		for (var idx = 0; idx < wholeProcess[campaign.time_ref.current_step].length; idx++){
			processAnimation.duration += wholeProcess[campaign.time_ref.current_step][idx].duration;
		}
		
		processAnimation._processId = 0;
		if (wholeProcess[campaign.time_ref.current_step].length > 0)
			processAnimation._PlayOneProcess();
	},
	
	Stop : function(){
		if (processAnimation._timeoutHandler != null){
			clearTimeout(processAnimation._timeoutHandler);
			processAnimation._timeoutHandler = null;
		}
	}
};